import request from '@/utils/request'
import {BaseResponse} from "@/api/types/baseResponse";
import {AttendanceGroupResponse} from "@/api/types/attendanceGroup";

//查
export function getAttendanceGroupInfo() {
    return request({
        url: '/kaoqin/attendancegroup',
        method: 'get',
    })
}

//修改
export function updateAttendanceGroupInfo(data: any) {
    return request({
        url: '/kaoqin/attendancegroup',
        method: 'put',
        data
    })
}

//增加
export function addAttendanceGroupInfo(data: any) {
    return request({
        url: '/kaoqin/attendancegroup',
        method: 'post',
        data
    })
}

//删除
export function delAttendanceGroupInfo(id: any) {
    return request({
        url: `/kaoqin/attendancegroup?id=${id}`,
        method: 'delete',
    })
}

// 查询人员是否冲突
export function exciteddanceGroupInfo(data: any) {
    return request({
        url: `/attendancegroup/find`,
        method: 'post',
        data
    })
}

// 查询所有考勤组
export function getAttendanceGroups() {
    return request<
        BaseResponse<{ info_list?: AttendanceGroupResponse[] }>,
        BaseResponse<{ info_list?: AttendanceGroupResponse[] }>
    >({
        url: "/kaoqin/attendancegroup",
        method: "GET"
    })
}
